<template>
    <div>
        <el-table
            :data="tableData"
            highlight-current-row
            @current-change="currentChange"
            style="width: 100%">

            <el-table-column
                prop="ip"
                label="主机IP">
            </el-table-column>
            <el-table-column
                prop="url"
                label="调用路径">
            </el-table-column>
            <el-table-column
                prop="count"
                label="调用次数）">
            </el-table-column>
             <el-table-column
                prop="time"
                label="调用时长（ms）">
            </el-table-column>
             <el-table-column
                prop="createTime"
                label="调用时间">
            </el-table-column>
            <el-table-column
                prop="username"
                label="用户名">
            </el-table-column>
        </el-table>
        <el-pagination class="pagination"
                       layout="prev, pager, next"
                       :total="totalCount" @current-change="handleCurrentChange">
        </el-pagination>
        <br/>
    </div>
</template>

<script>
    import Config from 'Config';
    import ElDialog from "../../../../node_modules/element-ui/packages/dialog/src/component.vue";
    import ElCol from "element-ui/packages/col/src/col";
    import ElButton from "../../../../node_modules/element-ui/packages/button/src/button.vue";
    export default {
        components: {
            ElButton,
            ElCol,
            ElDialog
        },
        data() {
            return {
                tableData: [],
                totalCount:0,
                query:{
                },
                form: {
                },
                errors:{
                },
                level:{
                    code:'',
                    name:''
                },
                college:{
                    code:'',
                    name:''
                },
                achievementType:{
                    code:'',
                    name:''
                },
                subject:{
                    code:'',
                    name:''
                },
                activeName: 'first',
                currentRow: null,
                detailDialogVisible: false,
                projectDialogVisible: false,
                updateApplicationNotPassVisible: false
            }
        },
        created () {
            this.handleQuery();
        },
        methods:{
            //翻页
            handleCurrentChange(page) {
                this.query.page = page;
                this.handleQuery();
            },
            handleQuery() {
                this.$axios.get(this.$config.SYSTEM_HOST + "/syslog/query"+this.$queryUtils.generateGetParameter(this.query)).then((res) => {
                    this.tableData = res.data.data.rows;
                    this.totalCount = res.data.data.totalCount;
                });
            }

        }
    }
</script>

